﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OnscreenKeyboard
{

    public partial class Mainform : Form
    {
        
        public Mainform()
        {
            InitializeComponent();
        }

        internal void DoCommand()
        {
            MessageBox.Show("Do a command here!");
        }

        private void button3_Click(object sender, EventArgs e)
        {

            Keybord VirtualKeyoard = new Keybord();
            
            VirtualKeyoard.PARENT = this;
            VirtualKeyoard.SetControl = InputrichText;
            int screenHeight = Screen.PrimaryScreen.WorkingArea.Height;
            int screenWidth = Screen.PrimaryScreen.WorkingArea.Width;
            Point parentPoint = this.Location;
            int parentHeight = this.Height;
            int parentWidth = this.Width;
            int resultX;
            int resultY;
            resultY = parentPoint.Y + (this.Height);
            resultX = parentPoint.X + 30;
            VirtualKeyoard.Location = new Point(resultX, resultY);
            //if you want to force
           // VirtualKeyoard.ShowDialog(this);
            VirtualKeyoard.Show(this);
        }

        private void buAbout_Click(object sender, EventArgs e)
        {
            AboutBox1 about = new AboutBox1();
            about.ShowDialog();
        }

        private void Mainform_Load(object sender, EventArgs e)
        {
            Keybord VirtualKeyoard = new Keybord();
            VirtualKeyoard.PARENT = this;
            VirtualKeyoard.SetControl = InputrichText;
            int screenHeight = Screen.PrimaryScreen.WorkingArea.Height;
            int screenWidth = Screen.PrimaryScreen.WorkingArea.Width;
            Point parentPoint = this.Location;
            int parentHeight = this.Height;
            int parentWidth = this.Width;
            int resultX;
            int resultY;
            resultY = parentPoint.Y + (this.Height);
            resultX = parentPoint.X + 30;
            VirtualKeyoard.Location = new Point(resultX, resultY);
            //if you want to force
             VirtualKeyoard.ShowDialog(this);
            //VirtualKeyoard.Show(this);
        }

        private void Mainform_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.Exit();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            Keybord VirtualKeyoard = new Keybord();

            VirtualKeyoard.PARENT = this;
            VirtualKeyoard.SetControl = InputText;
            int screenHeight = Screen.PrimaryScreen.WorkingArea.Height;
            int screenWidth = Screen.PrimaryScreen.WorkingArea.Width;
            Point parentPoint = this.Location;
            int parentHeight = this.Height;
            int parentWidth = this.Width;
            int resultX;
            int resultY;
            resultY = parentPoint.Y + (this.Height);
            resultX = parentPoint.X + 30;
            VirtualKeyoard.Location = new Point(resultX, resultY);
            //if you want to force
            // VirtualKeyoard.ShowDialog(this);
            VirtualKeyoard.Show(this);
        }

        private void button2_Click(object sender, EventArgs e)
        {

            Keybord VirtualKeyoard = new Keybord();

            VirtualKeyoard.PARENT = this;
            VirtualKeyoard.SetControl = InputCombo;
            int screenHeight = Screen.PrimaryScreen.WorkingArea.Height;
            int screenWidth = Screen.PrimaryScreen.WorkingArea.Width;
            Point parentPoint = this.Location;
            int parentHeight = this.Height;
            int parentWidth = this.Width;
            int resultX;
            int resultY;
            resultY = parentPoint.Y + (this.Height);
            resultX = parentPoint.X + 30;
            VirtualKeyoard.Location = new Point(resultX, resultY);
            //if you want to force
            // VirtualKeyoard.ShowDialog(this);
            VirtualKeyoard.Show(this);
        }
    }
}
